import "./App.css"
import React from "react"
import {useState,useEffect} from "react"

function App() {
  console.log("apprender")
  let [msg,setmsg] = useState(()=>{
    return "hahah"
  })

  const changemsg = ()=>{
    setmsg("修改后的数据"+new Date())
  }

  useEffect(()=>{
    console.log("有没有重复触发",msg)
  },[msg])

  return <div className="App" >
    测试生命周期会不会像类组件一样 即使state重复也会触发render
    <button onClick={changemsg}>修改数据 --- {msg}</button>
  </div>
}



export default App